/**
 *
 */
package uy.edu.um.taller2;

import java.rmi.RMISecurityManager;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

/**
 * @author pegardan
 *
 */
public class Main {

	public static void main(String[] args) {
		try {
			String name = "HelloWorldService";

			HelloWorldRemoteService oHelloWorldService = new HelloWorldRemoteService();

			HelloWorldRemote oStub = (HelloWorldRemote) UnicastRemoteObject
					.exportObject(oHelloWorldService, 0);

			Registry oRegistry = LocateRegistry.createRegistry(1099);

			oRegistry.rebind(name, oStub);

			System.out.println("Ready and waiting");
		} catch (Exception e) {
			System.err.println("error:");
			e.printStackTrace();
		}
	}

}
